<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    div {
      width: 200px;
      height: 100px;
      border: 1px solid red;
    }

  </style>
</head>

<body>
  <!-- align="center" -->
  <!-- title="People's Republic of China" -->
  <!-- <element dir="ltr|rtl|auto"> dir 属性规定元素内容的文本方向。 -->

  <div id="dv" align="center">
    Lorem ipsum dolor
  </div>
  <div id="div">
    Lorem ipsum dolor sit amet consectetur adipisicing elit
  </div>
  <script>
    let ids = document.getElementById("dv");
    ids.addEventListener("contextmenu", (e) => {
      e.preventDefault();
    });


    document.onkeydown = document.onkeyup = document.onkeypress = (event) => {
      let e = event || window.event || arguments.callee.caller.arguments[0];
      console.log(event);
      if (e && e.keyCode == 123) {
        e.returnValue = false;
        return (false);
      };
    };

  </script>

  <script>
    // 禁止复制文本内容
    // https://www.jianshu.com/p/701cc19d2c5a
    document.getElementById('div').onselectstart = () => {
      return false;
    };

  </script>
</body>

</html>
